<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%String path=request.getContextPath(); %>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="styles/common.css">
    <link rel="stylesheet" type="text/css" href="styles/login.css">
   
	<script src="scripts/jquery-3.3.1.js"></script>
	<script>
		$(function () {
			$("#btLogin").click(function () {
				$.post("login",$("#loginForm").serialize(),function (data) {
					if (data != null){
						if (data==1) {
							//跳转到GetGoodsList中
							location.href = "<%=path%>/GetGoodsList?pageNum=1";
						
						}
						else{
						 	alert("用户名或密码错误")
						
						}
					}
				});
			});
		});
	</script>
</head>

<body>

<div id="header"></div>
    <!-- 头部 end -->
    <section id="login_wrap">
        <div class="fullscreen-bg" style="background: url(images/login_bg.jpg);height: 532px;">
        	
        </div>
        <div class="login-box">
        	<div class="title" style="margin:0 auto ;" >
        		<span STYLE="color: white;display:block;text-align:center;">欢迎登录</span>
        	</div>
        	<div class="login_inner">

				
        		<div id="errorMsg" class="alert alert-danger" ></div>
				<form id="loginForm" action="" method="post" accept-charset="utf-8">
        			<input type="hidden" name="action" value="login"/>
					<input id="username"  name="username" type="text" placeholder="请输入账号" autocomplete="off">
        			<input name="password" id="password"  type="text" placeholder="请输入密码" autocomplete="off">
        			<div class="verify">
					<a href="admin.jsp">管理员入口</a>
					</div>
			<div class="submit_btn">
        				<button type="button" id="btLogin">登录</button>
        				<div class="auto_login">
        					<input type="checkbox" name="" class="checkbox">
        					<span>自动登录</span>
        				</div>        				
        			</div>        			       		
        		</form>
        		<div class="reg">没有账户？<a href="register.jsp">立即注册</a></div>
        	</div>
        </div>
    </section>
    <!--引入尾部-->
    <div id="footer"></div>
    <
</body>

</html>